package com.ml.mall.mapper.supplier;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ml.mall.bean.res.dashboard.RecentOrderRes;
import com.ml.mall.bean.res.supplier.SupplierDashboardQueryRes;
import com.ml.mall.bean.res.supplier.vo.SupplierDayDetailVo;
import com.ml.mall.entity.supplier.SysOrderSupplier;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface SysOrderSupplierMapper extends BaseMapper<SysOrderSupplier> {

    /**
     * @description    :查询最近订单，固定返回10条
     * @author         :dzh
     * @date           :2021/09/24
     **/
    @Select("select * from sys_order_supplier where oid = #{oid}")
    List<SysOrderSupplier> selectSordByOid(@Param("oid") Long oid);

    /**
     * @description    :查询最近订单，固定返回10条
     * @author         :zxm
     * @date           :2021/5/24
     **/
    List<RecentOrderRes> selectRecentOrder(@Param("companyId") Long companyId);

    /**
     * @description    :卖家查询总的销售额和买家订单数量
     * @author         :pl
     * @date           :2021/6/8
     **/
    SupplierDashboardQueryRes selectSalesPoNum(@Param("supplierId") Long supplierId,@Param("timeBegin") String timeBegin,@Param("timeEnd") String timeEnd);

    /**
     * @description    :卖家查询总的送达订单数量
     * @author         :pl
     * @date           :2021/6/8
     **/
    Integer selectDeliveredOrder(@Param("supplierId") Long supplierId,@Param("timeBegin") String timeBegin,@Param("timeEnd") String timeEnd);

    /**
     * @description    :卖家查询总的取消订单的数量
     * @author         :pl
     * @date           :2021/6/8
     **/
    Integer selectRejectOrder(@Param("supplierId") Long supplierId,@Param("timeBegin") String timeBegin,@Param("timeEnd") String timeEnd);

    /**
     * @description    :卖家查询卖出产品的总数量
     * @author         :pl
     * @date           :2021/6/8
     **/
    Integer selectVariantNum(@Param("supplierId") Long supplierId,@Param("timeBegin") String timeBegin,@Param("timeEnd") String timeEnd);

    /**
     * @description    :卖家查询仪表盘中某一天信息
     * @author         :pl
     * @date           :2021/6/8
     **/
    SupplierDayDetailVo selectOneDateDetail(@Param("supplierId") Long supplierId, @Param("queryCurTime") String queryCurTime);

    /**
     * @description: 查询限定日期内每天的详细数据
     * @author kyyang
     * @date 2021/8/4 23:07
     * @version 1.0
     */
    List<SupplierDayDetailVo> selectSupplierDateDetailByTimeLine(@Param("supplierId")Long supplierId, @Param("timeBegin")String timeBegin,@Param("timeEnd") String timeEnd);
}